package com.weilizhang.work1.mapper;


import com.weilizhang.work1.mojo.Students;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
@Mapper
public interface StudentsMapper {
    @Select("select * from students")
    List<Students> list();

    @Select("select * from students where student_id=#{studentId}")
    Students select(Integer studentId);
    @Delete("delete from students where student_id=#{studentId}")
    void delete(Integer studentId);

    @Update("update students set name=#{name},gender=#{gender},major=#{major} where student_id=#{studentId}")
    void update(Students students);

    void add(Students students);

    List<Students> search(Students students);
}

